package cn.trda.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {
	public static final String yyyyMMdd="yyyy-MM-dd";
	
	public static Date stringToDate(String yyyyMMdd,String date) throws Exception{
		SimpleDateFormat sdf=new SimpleDateFormat(yyyyMMdd);
		return sdf.parse(date);
	}
	
	public static String dateToString(String yyyyMMdd,Date date){
		SimpleDateFormat sdf=new SimpleDateFormat(yyyyMMdd);
		return sdf.format(date);
	}
}
